<script>
$(function(){
	$(".check-all").click(function(){
		$(".check-item,.check-all").attr("checked", this.checked);
	});

	$(".box-btn").click(function(){
		window.open(this.href, "_blank", "width=1000,height=700,scrollbars=yes");
		return false;
	})
});
</script>

<div class="block list-form">
	<div class="block-title"><?=$block_title?></div>
	
	<form method="post">
		<?php $this->widget('zii.widgets.grid.CGridView', array(
			'id'=>'user-grid',
			'dataProvider'=>$dataProvider,
			'columns'=>array(
				array(
					'type' => 'raw',
					'name' => "Select",
					'value' => 'CHtml::checkbox("users[]", null, array("value" => $data->user_id))',
				),
				array('name' => '会员账号', 'value' => '$data->user_id'),
				array('type'=> 'raw', 'name' => '加盟账号', 'value' => '"<a class=\'box-btn\' href=\'/index.php/admin/owner/edit?owner_id={$data->owner_id}\'>$data->owner_id</a>"'),
				array('name' => '注册网站', 'value' => '$data->website'),
				array('name' => '注册时间', 'value' => '$data->date_join'),
				array('type' => 'raw', 'name' => '审核状态', 'value' => 'str_replace(array("Y", "N", "P"), array("<span style=\'color:green\'>已认可</span>", "已否决", "<span style=\'color:blue\'>待审核</span>"), $data->accept)'),
				/*
				array(
					'class' => 'CButtonColumn',
					'template' => '{view}{delete}{pass}',
					'buttons' => array(
						'pass' => array(
							'label' => 'Accept',
							'url' => '"?/admin/owner/delete&id={$data->owner_id}"'
						)
					)
				)
				*/
			),
			
		)); ?>
		
		
		<div class="op-list">
			<input type="submit" class="op-btn" action="<?php echo $this->createUrl('user/update', array('accept' => 'Y'))?>" value="接受" />
			<input type="submit" class="op-btn" action="<?php echo $this->createUrl('user/update', array('accept' => 'N'))?>" value="否决" />
		</div>
		
		<script>
		$(function(){
			$(".op-btn").click(function(){
				$(this).parents('form:first').attr('action', $(this).attr('action')).submit();
			});
		});
		</script>
	</form>
</div>



